﻿using UnityEngine;
using System.Collections;

public class AttackHitbox : MonoBehaviour {

	Tiki _tiki;
	public bool attacking;

	bool _attacked;

	// Use this for initialization
	void Start () {
		_tiki = GetComponentInParent<Tiki> ();
		attacking = false;
		_attacked = false;
	}
	
	// Update is called once per frame
	void Update () {
		if (_tiki.animator.curAnimation == _tiki.animations [(int)TikiAnimations.ATTACK]) {
			if(_tiki.animator.curSprite >= 7 && !_attacked) {
				attacking = true;
				_attacked = true;
			} else if (_tiki.animator.curSprite < 7) {
				attacking = false;
				_attacked = false;
			}
		} else {
			attacking = false;
		}
	}
}
